import numpy as np
import xarray as xr
from matplotlib import pyplot as plt

data = xr.open_dataset('C:\\Users\\xjl\\Desktop\\NC-daily\\2024\\NSIDC0051_SEAICE_PS_N25km_20240101_v2.0.nc')

sic_data = sea_ice_concentration = data['F17_ICECON'].values[0]

sic_data[sic_data < 1.01] = 0
np.save("nsidc_landmask.npy",sic_data)
# 创建图像
plt.imshow(sic_data, cmap='Blues')
# 展示图像
plt.show()
